//
// Created by chencheng on 2020/9/21.
//
#include <jni.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C"{
#endif

jstring Java_top_codestudy_mylibrary_HelloActivity_get(JNIEnv *env,jobject thiz){
    printf("invoke get in c++\n");
    return env->NewStringUTF("hello from JNI in libjni-test.so!");
}
void Java_top_codestudy_mylibrary_HelloActivity_set(JNIEnv *env,jobject thiz,jstring string){
    printf("invoke set in c++\n");
    char *str = (char*) env->GetStringUTFChars(string,NULL);
    printf("%s\n",str);
    env->ReleaseStringUTFChars(string,str);
}

#ifdef __cplusplus
}
#endif
